//Shows error message as popup window
//To write own function for showing validation errors use the next pattern.
//
//IMPORTANT!!!!
// - Use array of errors messages as variable    messageText
// - You must to use this pattern to insert ID of element that will show error
//                     id='" + idError + "'
// - Use variable   element   as DOM element that is validated
function popup() {
    //Shows error message as pop-up
    var pos = element.offset();
    var message = messageText.join("");

    element.after("<em id='" + idError + "' class='error'>" + message + "</em>");
    var heightError = $("#"+idError).height();
    $("#"+idError).css("top", pos.top-heightError/2+5);
    $("#"+idError).css("display", "inline");
    $("#"+idError).animate({marginLeft: "5px", opacity: 0.9}, 500);
};